<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>数据分析</title>
        <link rel="stylesheet" href="style.css" type="text/css">
		<%@ include file="../jslib/jquerylib.jsp" %>
	    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>
        <script src="<%=request.getContextPath() %>/form/amcharts/amcharts.js" type="text/javascript"></script>        
        <script type="text/javascript">
            var chart;
            var chartData = ${datas};

            function initpage(){
            	AmCharts.ready(function () {
	                // SERIAL CHART
	                chart = new AmCharts.AmSerialChart();
	                chart.dataProvider = chartData;
	                chart.categoryField = "hengzhou";
	                chart.startDuration = 0.5;
	                chart.balloon.color = "#000000";
	 
	                // AXES
	                // category
	                var categoryAxis = chart.categoryAxis;
	                categoryAxis.fillAlpha = 1;
	                categoryAxis.fillColor = "#FAFAFA";
	                categoryAxis.gridAlpha = 0;
	                categoryAxis.axisAlpha = 0;
	                categoryAxis.gridPosition = "start";
	                categoryAxis.position = "bottom";
	 
	                // value
	                var valueAxis = new AmCharts.ValueAxis();
	                valueAxis.title = "${zongzhouname}";
	                valueAxis.dashLength = 5;
	                valueAxis.axisAlpha = 0;
	                valueAxis.integersOnly = true;
	                valueAxis.gridCount = 10;
	                chart.addValueAxis(valueAxis);

	                // GUIDE for 标准
	                ${biaozhunsb}
	                
	                // GRAPHS					            		
	                ${graphssb}

	                // LEGEND
	                var legend = new AmCharts.AmLegend();
	                legend.markerType = "circle";
	                chart.addLegend(legend);
	 
	                // WRITE
	                chart.write("chartdiv");

            	});
            }
            
            function showdetail(hengzhou,fenzu){
            	var queryColumn = "${hengzhou}";
            	if ('${fenzu}'=='-1'||'${fenzu}'=='${hengzhou}'){
            		window.open("<%=request.getContextPath() %>/auto!gotoListForAnalysisData.action?datainfoid=${datainfoid}&queryColumn=${hengzhou}&${hengzhou}="+hengzhou,null,"dialogWidth=1050px;dialogHeight=650px;resizable=yes;scroll=yes");
            	}
            	else{
            		window.open("<%=request.getContextPath() %>/auto!gotoListForAnalysisData.action?datainfoid=${datainfoid}&queryColumn=${hengzhou},${fenzu}&${hengzhou}="+hengzhou+"&${fenzu}="+encodeURIComponent(encodeURIComponent(fenzu)),null,"dialogWidth=1050px;dialogHeight=650px;resizable=yes;scroll=yes");
            	}
            	//window.showModalDialog("<%=request.getContextPath() %>/auto!gotoListForAnalysisData.action?datainfoid=${datainfoid}",null,"dialogWidth=1050px;dialogHeight=650px;resizable=yes;scroll=yes");
            }

        </script>
    </head>
    
    <body onload='initpage()'>
        <div id="chartdiv" style="width:100%;height:400px;"></div>
    </body>

</html>
